<template>
  <div class="edit">
    <el-form :model="form" label-width="120px">
      <el-form-item label="项目编号">
        <el-input v-model="form.projectNum" />
      </el-form-item>
      <el-form-item label="项目名称">
        <el-input v-model="form.projectName" />
      </el-form-item>
      <el-form-item label="项目描述">
        <el-input v-model="form.projectdescribe" />
      </el-form-item>
      <el-form-item label="项目负责人">
        <el-input v-model="form.projectManager" />
      </el-form-item>
      <el-form-item label="技术负责人">
        <el-input v-model="form.technicaler" />
      </el-form-item>
      <el-form-item label="产品负责人">
        <el-input v-model="form.product" />
      </el-form-item>
      <el-form-item label="测试负责人">
        <el-input v-model="form.tester" />
      </el-form-item>
      <el-form-item label="市场负责人">
        <el-input v-model="form.Marketer" />
      </el-form-item>
      <el-form-item label="当前阶段">
        <el-input v-model="form.projectStage" />
      </el-form-item>
      <el-form-item label="项目状态">
        <el-input v-model="form.projectState" />
      </el-form-item>
      <el-form-item label="开始日期">
        <el-input v-model="form.startDate" />
      </el-form-item>
      <el-form-item label="截止日期">
        <el-input v-model="form.endDate" />
      </el-form-item>
      <el-form-item>
      <el-button type="primary" @click="onSubmit">保存</el-button>
      <el-button @click=router.go(-1)>取消</el-button>
    </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { reactive,ref } from "vue";
import { useRoute,useRouter } from "vue-router";
import axios from "axios";

var route = useRoute();
var router = useRouter()
var form = ref({
  projectNum: 1,
  projectName: "",
  projectdescribe: "",
  projectManager: '',
  technicaler: '',
  product: "",
  tester: "",
  Marketer: '',
  projectStage: "",
  projectState: "",
  startDate: "",
  endDate: "",
});
form.value = route.query;



const onSubmit = () => {
  axios.post('/api/projectManage/edit',{form}).then((res)=>{
    if(res.status == 200){
        // alert('修改成功');
        router.go(-1);
    }
  })
};
</script>

<style>
.el-input{
    width: 200px;
}
</style>